import 'package:flutter_test/flutter_test.dart';
import 'package:proxy_check/proxy_check.dart';
import 'package:proxy_check/proxy_check_platform_interface.dart';
import 'package:proxy_check/proxy_check_method_channel.dart';
import 'package:plugin_platform_interface/plugin_platform_interface.dart';

class MockProxyCheckPlatform
    with MockPlatformInterfaceMixin
    implements ProxyCheckPlatform {

  @override
  Future<String?> getPlatformVersion() => Future.value('42');

  @override
  Future<bool?> checkProxy() {
    // TODO: implement checkProxy
   return Future.value(false);
  }
}

void main() {
  final ProxyCheckPlatform initialPlatform = ProxyCheckPlatform.instance;

  test('$MethodChannelProxyCheck is the default instance', () {
    expect(initialPlatform, isInstanceOf<MethodChannelProxyCheck>());
  });

  test('getPlatformVersion', () async {
    ProxyCheck proxyCheckPlugin = ProxyCheck();
    MockProxyCheckPlatform fakePlatform = MockProxyCheckPlatform();
    ProxyCheckPlatform.instance = fakePlatform;

    expect(await proxyCheckPlugin.getPlatformVersion(), '42');
  });

  test('checkProxy', () async {
    ProxyCheck proxyCheckPlugin = ProxyCheck();
    MockProxyCheckPlatform fakePlatform = MockProxyCheckPlatform();
    ProxyCheckPlatform.instance = fakePlatform;
    expect(await proxyCheckPlugin.checkProxy(), false);
  });
}
